// 公告相关的接口函数
import request from '@/utils/http.js'

//1-1.新增公告
export const addBulletinAPI=(data)=> {
  return request({
    url: '/bulletin/addBulletin',
    method: 'post',
    data:{
        bulletinTitle:data.bulletinTitle,
        bulletinText:data.bulletinText,
        bulletinAuthor:data.bulletinAuthor,
    }
  })
}

//2-1.分页获取公告
export const pageBulletinAPI=(data)=> {
  return request({
    url: '/bulletin/pageBulletin',
    method: 'post',
    data:{
        pageCurrent: data.pageCurrent,
        pageSize: data.pageSize,
        searchName: data.searchName,
    }
  })
}

//2-2.获取公告详情
export const queryBulletinDetailByIdAPI=(bulletinId)=> {
  return request({
    url: '/bulletin/queryBulletinDetailById',
    method: 'post',
    params:{bulletinId}
  })
}


//3-1.删除公告
export const deleteBulletinAPI=(bulletinId)=> {
  return request({
    url: '/bulletin/deleteBulletin',
    method: 'post',
    params:{bulletinId}
  })
}

//4-1.更新公告
export const updateBulletinAPI=(data)=> {
  return request({
    url: '/bulletin/updateBulletin',
    method: 'post',
    data:{
        bulletinId:data.bulletinId,
        bulletinTitle:data.bulletinTitle,
        bulletinText:data.bulletinText,
        bulletinAuthor:data.bulletinAuthor,
    }
  })
}